<?php

namespace app\store\service\wxapp;

use app\common\library\wechat\WxUser;
use app\common\service\BaseService;

/**
 * 推送模板消息服务类
 * Class Message
 * @package app\store\service\wxapp
 */
class User extends BaseService {
	// 分割符号
	const SEPARATOR = ',';

	/** @var array $stateSet 状态集 */
	private $stateSet = [];

	/** @var WxTplMsg $WxTplMsg 微信模板消息类 */
	private $WxUser;
 
	/**
	 * 构造方法
	 * Message constructor.
	 * @throws \app\common\exception\BaseException
	 * @throws \think\exception\DbException
	 */
	public function __construct() {
		// 实例化：微信模板消息类

		$app_id = 'wx6a1187d5e6821931';
		$app_secret = '80af63e63b0349a75172c16a48b3a50e';
		$this->WxUser = new WxUser($app_id, $app_secret);
	}

	/**
	 * @param $data
	 * @return bool
	 * @throws \app\common\exception\BaseException
	 * @throws \think\exception\DbException
	 */
	public function getUser($openid) {

		$result = $this->WxUser->getUser($openid);
		return $result;
	}
	public function getUnionid($openid) {

		$result = $this->WxUser->getUnionid($openid);
		return $result;
	}

}